/*
 * public-add.js  @bgg  TM2017-12-22
 */
function onloadFun(){
	//var winHeight = $("#page-wrapper").height();
	/*setTimeout(function(){
		var jqv = $(".ui-jqgrid-view");
		var winHeight = jqv.parents("body").height();
		console.info("h = "+winHeight);
		try{
			$(".portlet-body,.portlet-body>div").css("height",winHeight+"px");
			$(".table-jqgrid").setGridHeight(winHeight);
			jqv.css({"height":winHeight-(jqv.offset().top +50)+"px"});
			$(".ui-jqgrid-bdiv").css({"overflow-x":"auto","height":winHeight-(jqv.offset().top +90)+"px"});
		}catch(e){}
	},1000);*/
}
function publicInit(){
	var _EXIDtime = 0;
	var winHeight = $(window).height();
	try{
		var times = null;
		clearInterval(times);
		var footerTop = $("#footer").offset().top;
		$(".cssanimations,html[lang=zh]").addClass("custom-scrollable");
		//$("#page-wrapper").height(winHeight);
		var wrap = $("#wrapper");
		wrap.css("height",winHeight-50+"px");
		wrap.find(".portlet-body").css("height",winHeight-91+"px");
		var w = wrap.find(".table-responsive");
		
		if(!w){
			times = setInterval(function(){
				_EXIDtime++;//防止死循环
				w = wrap.find(".table-responsive");
				w.css("height",winHeight-246+"px");
				if(w || _EXIDtime >= 50) clearInterval(times);
			},100);
		}
	}catch(e){}
	try{
		if($(".ibox-content")) $(".ibox-content").height(winHeight-115);
		if($('#cc')) $('#cc').layout('resize',{height:winHeight-50});
	}catch(e){}
}
function init2(){
	var $cc = $(".easyui-layout");
	if($cc){
		var bodyh = $cc.parents("body").height();
		$(".easyui-layout,.easyui-layout .panel-body.layout-body").css("height",bodyh);
	}
}
$(function(){
	$(window).on("load resize",function(){
		//publicInit();
		init2();
	});
});
